package nl.hanze.monoalphabetic.domain;

/**
 *
 * @author alex
 */
public class StringCount implements Comparable {

    private Integer count;
    private String string;

    public StringCount(String string, Integer count) {
        this.string = string;
        this.count = count;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String getString() {
        return string;
    }

    public void setString(String string) {
        this.string = string;
    }

    /**
     * Comaparable voor aflopend sorteren (-1)
     * @param o
     * @return 
     */
    @Override
    public int compareTo(Object o) {
        StringCount other = (StringCount) o;
        return this.getCount().compareTo(other.getCount()) * -1;
    }
}
